<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
    <% String path=request.getContextPath(); String basePath=request.getScheme() + "://" + request.getServerName() + ":"
        + request.getServerPort() + path + "/" ; %>

        <!DOCTYPE html>
        <html>

        <head>
            <base href="<%=basePath%>">

            <title>收货信息打印单</title>

            <meta http-equiv="pragma" content="no-cache">
            <meta http-equiv="cache-control" content="no-cache">
            <meta http-equiv="expires" content="0">
            <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
            <meta http-equiv="description" content="This is my page">
            <!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

        </head>

        <body style="text-align:center">
            <%@ include file="/WEB-INF/jsp/common/headerSupply.jsp" %>
                <%@ include file="/WEB-INF/jsp/common/loadDiv.jsp" %>

                    <script type="text/javascript">

                        window.addEventListener('message', function (e) {
                            console.log(e.data) // e.data即为父页面中'要传的值'
                            var rows = e.data;
                            var index = 0;
                            for (var row of rows) {
                                if ($('#corpName').val()) {
                                    if (row.infName != $('#corpName').val()) {
                                        $.messager.alert('提示', '供应商不一致');
                                        return;
                                    }
                                } else {
                                    $('#corpName').html(rows[0].godCompanyName);
                                }
                                var len = $('#ttGoods tr').length;
                                index++;
                                var trHtml = "<tr align='center'>";
                                trHtml += "<td>" + (len - 1) + index + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmDetail + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "<td>" + row.mmCode + "</td>";
                                trHtml += "</tr>";
                                console.log(trHtml);
                                $('#ttGoods').append(trHtml);
                            }


                        }, false);


                        $(function () {
                            // var id = getQueryVariable('id');
                            // initInfo(id);
                        });

                    </script>


                    <style scoped="scoped">
                        .table td {
                            border: 1px solid grey;
                        }

                        .table {
                            border-collapse: collapse;
                            /* 							text-align: center; */
                            width: 900px;
                        }

                        .div-in-center {
                            margin: 0 auto;
                            width: 900px;
                        }

                        span {
                            word-break: normal;
                            width: auto;
                            display: block;
                            white-space: pre-wrap;
                            word-wrap: break-word;
                            overflow: hidden;
                            text-align: left;
                        }
                    </style>

                    <div class="div-in-center">
                        <table style="width: 900px;text-align: center;">
                            <tr>
                                <td><span id="corpName" style="text-align: center;"></span></td>
                            </tr>
                        </table>
                        <table>
                            <tr>
                                <td>
                                    <table>
                                        <tr>
                                            <td>供应商名称：</td>
                                            <td><span id="visConName"></span></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <table class="table" id="ttGoods">
                            <tr>
                                <td>序号</td>
                                <td>移动类型</td>
                                <td>物料凭证</td>
                                <td>物料编码</td>
                                <td>物料描述</td>
                                <td>规格型号</td>
                                <td>数量</td>
                                <td>单位</td>
                                <td>库位</td>
                                <td>采购员</td>
                                <td>单价</td>
                                <td>金额</td>
                                <td>备注</td>
                            </tr>
                        </table>
                        <table>
                            <tr>
                                <td style="width: 600px;">
                                    <table>
                                        <tr>
                                            <td>制单人：</td>
                                            <td></td>
                                        </tr>
                                    </table>
                                </td>
                                <td>
                                    <table>
                                        <tr>
                                            <td>仓管员:</td>
                                            <td></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <!-- <div style="padding: 5px; text-align: right;">
									<a class="easyui-linkbutton" onclick="save();" iconcls="icon-save">保存</a>
								</div> -->
                    </div>
        </body>

        </html>